package com.bookmall.product.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.bookmall.common.entity.MyBaseEntity;
import com.ruoyi.common.core.annotation.Excel;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 书籍基本信息 book_info
 * @Author 胡菜鸡
 * @Create 2022-02-18-15:03
 */
@Data
@TableName("book_info")
public class BookInfo extends MyBaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 书本id */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /** 上架此书本的学生id */
    @Excel(name = "上架此书本的学生id")
    private String uid;

    /** 书本名称 */
    @Excel(name = "书本名称")
    @TableField(condition = SqlCondition.LIKE)
    private String bookName;

    /** 书本成色(1-9表示1-9成新，0表示全新) */
    @Excel(name = "书本成色", readConverterExp = "0=全新,1=一成新,2=两成新,3=三成新,4=四成新,5=五成新,6=六成新,7=七成新,8=八成新,9=九成新,")
    private Integer bookLevel;

    /** 书本价格(0表示私聊) */
    @Excel(name = "书本价格(0=私聊)")
    private BigDecimal bookPrice;

    /** 书籍原价 */
    @Excel(name = "书籍原价")
    private BigDecimal bookOriginalPrice;

    /** 优惠比率 */
    @Excel(name = "优惠比率")
    private BigDecimal percent;

    /** 书本类别id（关联 book_category） */
    private String bookType;

    /** 书籍类别的名称 */
    @Excel(name = "书本类别")
    private String bookTypeName;

    /** 书本数量 */
    @Excel(name = "书本数量")
    private Long bookCount;

    /** 被锁定的书籍数量 */
    @Excel(name = "被锁定的书籍数量")
    private Long countStockLocked;

    /** 交易方式 */
    @Excel(name = "交易方式", readConverterExp = "0=任意,1=线下支付,2=微信,3=支付宝,4=其他")
    private Integer transaction;

    /** 商品评价 */
    @Excel(name = "商品评价")
    private Integer evaluate;

    /** 书籍是否展示(0展示，1不展示) */
    @Excel(name = "书籍是否展示", readConverterExp = "0=展示,1=不展示")
    private Integer status;

    @TableField(exist = false)
    private List<BookInfoImages> bookInfoImages;

    @TableField(exist = false)
    private String bookDesc;
}
